import axios from './request.js'; 
import qs from 'qs';

export function goPay(params){
  return axios.post('pay/initiative',qs.stringify(params));
}
export function get(url, params){    
  var token = localStorage.getItem("token")  
  return new Promise((resolve, reject) =>{        
     return axios.get(url, { headers: {'Token':  token } } ).then(res => { resolve(res.data);}).catch(err =>{ reject(err)        
  })    
});}

export function post(url, params){  
  var token = localStorage.getItem("token")   
  return new Promise((resolve, reject) =>{        
      return axios.post(url,  params, {  headers: {'Token':  token } }).then(res => { resolve(res.data);}).catch(err =>{ reject(err)        
  })    
});}
/*
共有的接口可以写到此处
*/ 